package hjw.com.service;

import hjw.com.dao.BookMapper;
import hjw.com.entity.Book;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>Project:Academic - BookServiceImpl
 *
 * @author IvanWei玮 -- maste
 * @version 1.0
 * @DataTime 2025/1/20 17:21
 * @since 1.8
 */
@Service
public class BookServiceImpl implements BookService{
    private final BookMapper bookMapper;

    @Autowired(required = false)
    public BookServiceImpl(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    @Override
    public Book findById(String id) {
        return bookMapper.findById(id);
    }

    @Override
    public List<Book> findByParams(Map<String, Object> map) {
        return bookMapper.findByParams(map);
    }

    @Override
    public int findByTypeCount(Map<String, Object> map) {
        return bookMapper.findByTypeCount(map);
    }

    @Override
    public List<Book> findAll() {
        return bookMapper.findAll();
    }

    @Override
    public List<Book> findByPage(Map<String, Object> map) {
        return bookMapper.findByPage(map);
    }

    @Override
    public List<Book> findBySalenum() {
        return bookMapper.findBySalenum();
    }

    @Override
    public List<Book> findByNews() {
        return bookMapper.findByNews();
    }

    @Override
    public List<Book> findPageByKey(Map<String, Object> map) {
        return bookMapper.findByPage(map);
    }

    @Override
    public int update(Map<String, Object> map) {
        return bookMapper.update(map);
    }

    @Override
    public int add(Map<String, Object> map) {
        return bookMapper.add(map);
    }

    @Override
    public int delete(Integer id) {
        return bookMapper.delete(id);
    }
}
